﻿//文件指定编译编码UTF-8
#pragma execution_character_set("utf-8")

/**
*    @file:    testdialog.cpp
*    @brief:
*    @author:  sanshi522@163.com
*    @date:    2025-02-20  17:14
*/
#include "networkstationident.h"
#include "testdialog.h"
#include "ui_testdialog.h"
#include <QMessageBox>

TestDialog::TestDialog(QString path,QWidget *parent) :
    QDialog(parent),
    ui(new Ui::TestDialog)
{
    ui->setupUi(this);
    filePath = path;
}

TestDialog::~TestDialog()
{
    delete ui;
}

void TestDialog::on_noBtn_clicked()
{
    QDialog::reject();
}

void TestDialog::on_okBtn_clicked()
{
    NetWorkStationIdent netWorkStationIdent(filePath.toStdString());
    string stationType;
    if(netWorkStationIdent.identify(
                stationType,
                ui->freq->value(),
                ui->modRate->value(),
                ui->modType->text().toStdString(),
                ui->codeType->text().toStdString())){
        QMessageBox::information(this,"识别成功",QString::fromStdString(stationType));

    }else{
        QMessageBox::critical(this,"识别失败",QString::fromStdString(stationType));
    }
}
